<!--
1. 如果不想让所有的元素都使用同一种动画，那么就给transition标签添加name属性。
    如此一来，这个transition标签中的元素里的动画的css样式就以name的值开头了。



-->


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../lib/vue.js"></script>
    <style>
        .v-enter, .v-leave-to{
            opacity: 0;
            transform: translateX(80px);
        }
        .v-enter-active, .v-leave-active{
            transition: all 0.4s ease
        }

        .my-enter, .my-leave-to{
            opacity: 0;
            transform: translateY(80px);
        }
        .my-enter-active, .my-leave-active{
            transition: all 0.4s ease
        }
    </style>

</head>
<body>
    <div id="app">
        <button @click="toggle">toggle</button>
        <transition name="my">
            <h3 v-show="flag">Hello Job!</h3>
        </transition>

    </div>
    <script>
        var vm=new Vue({
           el:"#app",
           data:{
               flag:false
           },
           methods:{
               toggle(){
                   this.flag=!this.flag;
               }
           }
        });
    </script>
</body>
</html>